<?php

function journee_get_list() {
        $sql = 'SELECT * FROM journee ORDER by numero;';
        return query($sql);
}

function journee_get_id($num) {
        $sql = 'SELECT ID FROM journee WHERE numero='.$num.';';
        return query($sql);
}

function journee_get_num($num) {
        $sql = 'SELECT numero FROM journee WHERE ID='.$num.';';
        return query($sql);
}

function journee_existe($num) {
		$sql = 'SELECT numero FROM journee WHERE numero='.$num.' LIMIT 1;';
        return query($sql);
}

function journee_creer($num) {
		$sql = "INSERT INTO journee VALUES ('', '$num');";
        return query($sql);
}

function delete_all_journee(){
		$sql = 'DELETE FROM `journee`;'; 
		return query($sql);
}